<!-- 伪元素选择器 -->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>伪元素选择器</title>
    <style>

        div {
            width: 300px;
            height: 300px;
            background-color: skyblue;
        }

        /* 伪元素选择器默认是行内显示样式 */
        /* 使用时必须加上content标签 */

        div::before {
            content: "内容前的附加";

            width: 100px;
            height: 100px;
            background-color: slategray; 

            /* 转换成块级显示 */
            /* display: block;*/
        }

        div::after {
            content: "内容后的附加";

            width: 100px;
            height: 100px;
             background-color: slategray; 
        }
    </style>
</head>
<body>
    <div>内容</div>
</body>
</html>